package com.atguigu.day04.test;

/**
*
*@Author 马冰
*@Data 2024.11.2 11.54
*
*/
class ForExer3 {
    public static void main(String[] args) {
        for (int i = 1; i <= 200; i++) {
            String info = "";
            if (i % 3 == 0) {
                info = " foo ";
            }
            if (i % 5 == 0) {
                info += " biz ";
            }
            if (i % 7 == 0) {
                info += " baz ";
            }
            System.out.println(i + info);


            //System.out.println(i % 3 == 0 ? i + " foo " + ((i % 5 == 0) ? " biz " + ((i % 7 == 0) ? " baz " : " " ) : ((i % 7 == 0) ? " baz " : " " )) : ((i % 5 == 0) ? i + " biz " + ((i % 7 == 0) ? " baz " : " ") : i % 7 == 0 ? i + " baz " : i +" "));


            /*if (i % 3 == 0 || i % 5 == 0 || i % 7 == 0) {
                System.out.print(i + " ");
                if (i % 3 == 0) {
                    System.out.print("foo ");
                }
                if (i % 5 == 0) {
                    System.out.print("biz ");
                }
                if (i % 7 == 0) {
                    System.out.print("baz ");
                }
                System.out.println();
            }else {
                System.out.println(i);
            }*/
        }
    }
}

class ForExer2 {
    public static void main(String[] args) {
        for (int i = 0; i <= 999; i++) {
            /*if (((i / 100) * (i / 100) * (i / 100) + ((i / 10) % 10) * ((i / 10) % 10) * ((i / 10) % 10) + (i % 10) * (i % 10) * (i % 10)) == i) {
                System.out.println(i);
            }*/
            int a = i / 100;
            int b = i / 10 % 10;
            int c = i % 10;
            if (a * a * a + b * b * b + c * c * c == i) {
                System.out.println(i);
            }
        }
    }
}

public class ForExer {
    public static void main(String[] args) {
        for (int i = 0; i <= 100; i++) {
            if (i % 2 == 0) {
                System.out.println(i);
            }
            //System.out.print(i % 2 == 0 ? i + "\n" : "");
        }
    }
}
